﻿@using System.Web.Optimization;
@model Everynet.Models.signUpModel
@{
    ViewBag.Title = "Configuration";
    Layout = "~/Views/Shared/_SignUpLayout.cshtml";
}
<div id='screen'>
</div>
<div class="body-page">
    <h1 class="top-head">
        Configuration</h1>
    <h2 class="signup-form-heading">
        Signup step 3 of 6
    </h2>
    <span class="floatright"><span class="red">*</span> these fields are required &nbsp;
        <span id='loadingmessage' class="displaynone">
            <img src=" @Url.Content("~/Content/images/loading.gif")" alt="Please wait..."/>
        </span></span>
    <div id='loaderCenter' class="displaynone" style="z-index: 10000;">
        <img src="@Url.Content("~/Content/images/ajax_loader_gray.gif")" alt="Please wait..." class="ajax-loader"/>
        <p class="loadertext">
            Please wait...</p>
    </div>
    <br />
    <br />
    @section StyleConfiguration
    {
     @Styles.Render("~/Content/bundledconfigcss")
    }
    @using (Html.BeginForm("ConfigurationUpdateUsers", "signUp", FormMethod.Post, new { id = "mySignupConfigForm" }))
    {
        @Html.AntiForgeryToken()
        <span id="divErrOthertopUserName" class="validation-summary-errors" style="display: none;">
        </span>
        <span id="divErrOthertopProvider" class="validation-summary-errors" style="display: none;">
        </span>
        
        <span id="divErrConnectionMethod" class="validation-summary-errors" style="display: none;">
        </span>
        <span id="divErrDirectoryListing" class="validation-summary-errors" style="display: none;">
        </span>
        
        <span id="divErrOthertop" class="validation-summary-errors" style="display: none;">
        </span>
        <span id="divErrDynamicGrid" class="validation-summary-errors" style="display: none;">
        </span>
        <span id="divErrDynamicContract" class="validation-summary-errors" style="display: none;">
        </span>
         <span id="divErrDynamicGridH" class="validation-summary-errors" style="display: none;">
        </span>
   
        @Html.ValidationSummary()
     
        @Html.HiddenFor(m => m.ID)
        @Html.HiddenFor(m => m.ServicePhoneNumber)
        @Html.HiddenFor(m => m.Title)
        @Html.HiddenFor(m => m.PlanNamesDetailID)
        @Html.HiddenFor(m => m.PlanQuotaID)
        @Html.HiddenFor(m => m.strSubExtrasDetailID)
        @Html.HiddenFor(m => m.strExtraPlanQuotaID)
        @Html.HiddenFor(m => m.strSubHardwareDetailID)
        <div id="accordion">
            <h3>
                <a href="javascript:void(0);"><span class="configheader">Contact Details</span></a></h3>
            <div class="contactdetal">
                <div>
                    We will use these details for your account, to send you bills, and to contact you.
                    <br />
                    <br />
                    <table cellspacing="0" cellpadding="0" border="0" class="NoBorder">
                        <tbody>
                            <tr>
                                <td width="160">
                                    <div style="text-align: right;" class="label-taxt">
                                        @Html.LabelFor(m => m.Title)<span class="red">*</span>
                                    </div>
                                </td>
                                <td>
                                    <div class="input-box">
                                        @Html.DropDownListFor(m => m.SelectedTitleItem, Model.SelectedTitle, "Select Title", new { @class = "checkvalidationtitle" })<div
                                            id="selectedTitleValidation" class="floatright">
                                        </div>
                                        <br />
                                        @Html.ValidationMessageFor(m => m.SelectedTitleItem)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="160">
                                    <div style="text-align: right;" class="label-taxt">
                                        @Html.LabelFor(m => m.FirstName)<span class="red">*</span>
                                    </div>
                                </td>
                                <td>
                                    <div class="input-box">
                                        @Html.TextBoxFor(m => m.FirstName, new { @class = "checkvalidationstring" })
                                        <div id="firstnameValidation" class="floatright">
                                        </div>
                                        <br />
                                        @Html.ValidationMessageFor(m => m.FirstName)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="160">
                                    <div style="text-align: right;" class="label-taxt">
                                        @Html.LabelFor(m => m.LastName)<span class="red">*</span>
                                    </div>
                                </td>
                                <td>
                                    <div class="input-box">
                                        @Html.TextBoxFor(m => m.LastName, new { @class = "checkvalidationstring" })
                                        <div id="lastnameValidation" class="floatright">
                                        </div>
                                        <br />
                                        @Html.ValidationMessageFor(m => m.LastName)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="160">
                                    <div style="text-align: right;" class="label-taxt">
                                        @Html.LabelFor(m => m.MobileNumber)
                                    </div>
                                </td>
                                <td>
                                    <div class="input-box">
                                        @Html.TextBoxFor(m => m.MobileNumber, new { @class = "checkvalidationinteger" })
                                        <div id="mobileValidation" class="floatright">
                                        </div>
                                        <br />
                                        @Html.ValidationMessageFor(m => m.MobileNumber)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="160">
                                    <div style="text-align: right;" class="label-taxt">
                                        @Html.LabelFor(m => m.ServiceAddress)<span class="red">*</span>
                                    </div>
                                </td>
                                <td>
                                    <div class="input-box">
                                        @Html.TextBoxFor(m => m.ServiceAddress, new { @class = "checkvalidationAddress" })
                                        <div id="serviceaddressValidation" class="floatright">
                                        </div>
                                        <br />
                                        @Html.ValidationMessageFor(m => m.ServiceAddress)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="160">
                                    <div style="text-align: right;" class="label-taxt">
                                        @Html.LabelFor(m => m.Email)<span class="red">*</span>
                                    </div>
                                </td>
                                <td>
                                    <div class="input-box">
                                        @Html.TextBoxFor(m => m.Email, new { @class = "checkvalidationemail" })
                                        <div id="emailValidation" class="floatright">
                                        </div>
                                        <br />
                                        @Html.ValidationMessageFor(m => m.Email)
                                           <span class="field-validation-error" style="display:none;" id="spnEmailExists">
                                                        <span >Email already in use.</span>
                                        </span>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <br />
                    <a id="aMoveNext" class="floatright next" href="javascript:void(0);">Next</a>
                </div>
            </div>
            <br />
            <br />
            @*check it have Plan detail and contract Length values, then only show Plan.*@
            @if (Model.listPlanDetail.Count() > 0 && Model.listPlanQuotaModel.Count() > 0)
            {
                <h3>
                    <a href="javascript:void(0);"><span class="configheader checkCount">@Model.Name</span></a></h3>
                <div class="contactdetal">
                    <table class="contacttable">
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <b>QUOTA</b>
                            </td>
                            <td>
                                <b>$ PER MONTH</b>
                            </td>
                        </tr>
                        @foreach (var item in Model.listPlanDetail.Select((value, i) => new { i, value }))
                        {
        
                            <tr>
                                <td>
                                    @if (@item.value.PlanNamesDetailID == @Model.PlanNamesDetailID)
                                    {
                                        @Html.RadioButtonFor(m => item.value.PlanDetailName, item.value.PlanNamesDetailID, new { Checked = "checked", @class = "rdselect" })
                                    }
                                    else if (@Model.PlanNamesDetailID == null && item.i == 0)
                                    {
                                        @Html.RadioButtonFor(m => item.value.PlanDetailName, item.value.PlanNamesDetailID, new { Checked = "checked", @class = "rdselect" })
                                    }
                                    else
                                    {
                                        @Html.RadioButtonFor(m => item.value.PlanDetailName, item.value.PlanNamesDetailID, new { @class = "rdselect" })
                                    }
                                </td>
                                <td>@item.value.PlanDetailName
                                </td>
                                <td>@item.value.PlanDetailQuota
                                </td>
                                <td>
                                    $@item.value.Price
                                </td>
                            </tr>
                        }
                    </table>
                    <br />
                    <div class="div90">
                        <div class="txtboxes60">@Html.LabelFor(m => m.UserName)<span class="red">*</span></div>
                        <div>@Html.TextBoxFor(m => m.UserName, new { @class = "checkvalidationUsername padleft10" })
                            @@everynet.com.au<div id="UsernameValidation" class="floatright">
                            </div>
                            <br />
                            <span style="padding-left: 10px;" id="divErrInsideUserName" class="validation-summary-errors font10"
                                style="display: none;"></span>
                            @Html.ValidationMessageFor(m => m.UserName)
                        </div>
                    </div>
                    <div class="div90">
                        <div class="txtboxes80">
                        </div>
                        <div class="fnt12" style="padding-left: 140px;">
                            Users names must be inoffensive, and not already used by another EveryNet user.
                            They must be at least 6 characters in length and cannot start with a number.
                            <br />
                            <br />
                            This username will be used as your primary everynet email address (youruser@everynet.com.au
                            for example).
                        </div>
                    </div>
                    <br />
                    <div class="div60">
                        <div class="txtboxes" style="margin-top: 0px;">
                            Contract Length</div>
                            <table width="400px" id="tblMainContract">
                            <tr>
                            <td>
                            <b>Minimum Term</b>
                            </td>
                            <td>
                             <b>Setup Cost</b>
                            </td>
                            <td>
                             <b>Exit Fee</b>
                            </td>
                            <td>
                            <b>Description</b>
                            </td>
                            </tr>
                           
                        @*<div class="padlef142" style="margin-top: 5px;">*@
                            @foreach (var item in Model.listPlanQuotaModel.Select((value, i) => new { i, value }))
                            {
                                <tr>
                                @*value in database*@
                                
                                @if (@item.value.PlanQuotaID == @Model.PlanQuotaID)
                                {
                                     
                                   <td>@Html.RadioButtonFor(m => item.value.PlanQuotaValue, item.value.PlanQuotaID, new { Checked = "checked", @class = "rdselectcontract" })<text>&nbsp;</text>@item.value.PlanQuotaValue<text>&nbsp;</text>@item.value.PlanQuotaInterval</td>
                                   <td>$@item.value.SetupCost</td>
                                   <td>$@item.value.EarlyExitFee </td>
                                   <td>@item.value.Comment</td>
                                  
                                }
                                @*first time bind*@
                                else if (@Model.PlanQuotaID == null && item.i == 0)
                                {

                                  <td>@Html.RadioButtonFor(m => item.value.PlanQuotaValue, item.value.PlanQuotaID, new { Checked = "checked", @class = "rdselectcontract" })<text>&nbsp;</text>@item.value.PlanQuotaValue<text>&nbsp;</text>@item.value.PlanQuotaInterval </td>
                                  <td>$@item.value.SetupCost </td>
                                 <td>$@item.value.EarlyExitFee </td>
                                 <td>@item.value.Comment </td>
                                }
                                @*other values*@
                                else
                                {
                                  <td>@Html.RadioButtonFor(m => item.value.PlanQuotaValue, item.value.PlanQuotaID, new { @class = "rdselectcontract" })<text>&nbsp;</text>@item.value.PlanQuotaValue<text>&nbsp;</text>@item.value.PlanQuotaInterval </td>
                                  <td>$@item.value.SetupCost </td>
                                  <td>$@item.value.EarlyExitFee </td>
                                  <td>@item.value.Comment </td>
                                }
                                </tr>
                                @*<br />*@
                            }
                        @*</div>*@
                         </table>
                    </div>
                    <br />
                    <div class="div80 drppadding">
                        <div class="txtboxes81">@Html.LabelFor(m => m.ADSLprovider)<span class="red">*</span></div>
                        <div>
                            @Html.DropDownListFor(m => m.ADSLprovider, Model.SelectedADSL, "Please select an option", new { @class = "checkvalidationAdsl" })<div
                                id="selectedAdslValidation" class="floatright">
                            </div>
                            <br />
                            <span id="divErrInsideADSLProvider" class="validation-summary-errors font10" style="display: none;">
                            </span><span>@Html.ValidationMessageFor(m => m.ADSLprovider)</span>
                        </div>
                    </div>
                    <div class="div80 drppadding" id="divshowhideOther">
                        <div class="txtboxes81">@Html.LabelFor(m => m.ADSLproviderOther)<span class="red">*</span></div>
                        <div>@Html.TextBoxFor(m => m.ADSLproviderOther, new { @class = "checkvalidationOther" })<div
                            id="OtherValidation" class="floatright">
                        </div>
                            <br />
                            <span id="divErrOther" class="validation-summary-errors font10" style="display: none;">
                            </span>
                        </div>
                    </div>
                    @{
                            string ChkplanNamesID = String.Empty;
                            if (Request.Cookies["MainCookie"] != null)
                            {
                                String Getvalue = Request.Cookies["MainCookie"].Value.ToString().Replace("%7C", "|").Replace("%20", " ");
                                string[] GetValue1 = Getvalue.Split('|');
                                ChkplanNamesID = GetValue1[0].ToString();
                            }
                      
                    }
                    @{String StrBundleADSLHomephone = ((int)(Everynet.Models.signUpModel.enumPlanNames.BundleADSLHomephone)).ToString();}
                    @{String StrBundleADSLVOIP = ((int)(Everynet.Models.signUpModel.enumPlanNames.BundleADSLVOIP)).ToString();}
                    @{String StrBundleADSLHomephonePlusVOIP = ((int)(Everynet.Models.signUpModel.enumPlanNames.BundleADSLHomephonePlusVOIP)).ToString();}
                    @if (ChkplanNamesID == StrBundleADSLHomephone || ChkplanNamesID == StrBundleADSLVOIP || ChkplanNamesID == StrBundleADSLHomephonePlusVOIP)
                    {
@*Only show for Bundles Start*@
                        <div class="div100 drppadding">
                            <div class="txtboxes24">@Html.LabelFor(m => m.ConnectionMethodID)<span class="red">*</span></div>
                            <div class="margin27">
                                @Html.DropDownListFor(m => m.ConnectionMethodID, Model.SelectedConnectionMethod, "Please select an option", new { @class = "checkvalidationConn" })<div
                                    id="selectedConnValidation" class="floatright">
                                </div>
                                <br />
                                <span id="divErrInsideConn" class="validation-summary-errors font10" style="display: none;">
                                </span><span>@Html.ValidationMessageFor(m => m.ConnectionMethodID)</span>
                            </div>
                        </div>
                        <div class="div100">
                            <div class="txtboxes24">@Html.LabelFor(m => m.DirectoryListingID)<span class="red">*</span></div>
                            <div class="margin27">
                                @Html.DropDownListFor(m => m.DirectoryListingID, Model.SelectedDirectoryListing, "Please select an option", new { @class = "checkvalidationDir" })<div
                                    id="selectedDirValidation" class="floatright">
                                </div>
                                <br />
                                <span id="divErrInsideDir" class="validation-summary-errors font10" style="display: none;">
                                </span><span>@Html.ValidationMessageFor(m => m.DirectoryListingID)</span>
                            </div>
                        </div>
@*Only show for Bundles End*@
                        <br />
                    }
                    <a id="aMoveNextmain" class="floatright next" href="javascript:void(0);">Next</a>
                </div>
            }
            else
            {
                <span id="spnRemoveclasses">Please contact Administrator to Add the Plan detail or Contract
                    Length.</span>
            }
            @{Int32 inctop = 1;}
            @if (@Model.listSubExtraDetailModel.Count() > 0 && Model.listExtraPlanQuotaModel.Count() > 0)
            {
                @*Dynamic Loop Start*@
                foreach (var items in Model.listSubExtraModel)
                {
                <br /><br />
                <h3>
                    <a href="javascript:void(0);"><span class="configheader">@items.SubExtrasName</span></a></h3>
                <div class="contactdetal">
                    <table class="contacttabledynamic">
                        <tr>
                            <td colspan="3" class="clsNothanksmargin">
                                <input type="checkbox" name="nothanks" class="clsNothanks" />
                                <b>I will provide my own.</b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <b>$ PER MONTH</b>
                            </td>
                        </tr>
                        @{Int32 inc = 0;}
                        @foreach (var item in @Model.listSubExtraDetailModel.ToList())
                        {
                            if (@item.SubExtrasID == @items.SubExtrasID)
                            {
                         
                            <tr class="countforPlans">
                                <td>
                                    @Html.RadioButtonFor(m => @item.SubExtrasDetailName, @item.SubExtrasDetailID, new { @class = "rdselectdynamic", @rel = inctop })
                                </td>
                                <td>
                                    @item.SubExtrasDetailName
                                </td>
                                <td>
                                    @item.SubExtrasDetailPrice
                                </td>
                            </tr>
                                inc++;
                            }

                        }
                        <tr style="background-color: transparent;">
                            <td>
                                <span class="divErrDynamicGridMultiple validation-summary-errors font10" style="display: none;">
                                </span>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <div class="div60 contactdetaildynamicfull">
                        <div class="txtboxes" style="margin-top: 0px;">
                            Contract Length</div>
                              <table width="80%" id="tblMainContractExtras">
                            <tr>
                            <td>
                            <b>Minimum Term</b>
                            </td>
                            <td>
                             <b>Setup Cost</b>
                            </td>
                            </tr>

                        @*<div class="padlef142">*@
                            @{Int32 incContract = 0;}
                            @foreach (var itemcon in Model.listExtraPlanQuotaModel.ToList())
                            {
                            <tr>
                                @if (@items.SubExtrasID == @itemcon.SubExtrasID)
                                {
                                
                                <td>@Html.RadioButtonFor(m => itemcon.ExtraPlanQuotaValue, itemcon.ExtraPlanQuotaID, new { @class = "rdselectcontractdynamic", @rel = inctop + "_con" })<text>&nbsp;</text>@itemcon.ExtraPlanQuotaValue<text>&nbsp;</text>@itemcon.ExtraPlanQuotaInterval</td>
                                <td>$@itemcon.ExtraSetupCost </td>
                                
                                    incContract++;
                                }
                                </tr>
                            }
                             
                            </table>
                            <span class="divErrDynamicContractmultiple validation-summary-errors font10" style="display: none;">
                                 </span>
                        @*</div>*@
                    </div>
                  
                  
                       @if (@Model.listSubHardwareDetailModel.Count() == 0)
                       {
                           if (inctop != Convert.ToInt32(Model.listSubExtraModel.Count()))
                           { 
                            <a id="aMoveNext_@(inctop)" class="floatright adynamicNext next" href="javascript:void(0);">
                                Next</a>
                           }
                       }
                       else
                       {
                            <a id="aMoveNext_@(inctop)" class="floatright adynamicNext next" href="javascript:void(0);">
                            Next</a>
                       }
                </div>
                @*Dynamic Loop End*@
                       inctop++;
                }
            }
             
              @{Int32 inctopH = 1;}
              @{Int32 inctopIncH = inctop;}
             @if (@Model.listSubHardwareDetailModel.Count() > 0)
             {
                  @*Dynamic Loop Hardware Start*@
                 foreach (var items in Model.listSubHardwareModel)
                 {
                  <br /><br />
                  <h3><a href="javascript:void(0);"><span class="configheader">@items.SubHardwareName</span></a></h3>
                    <div class="contactdetal">
                     <table class="contacttabledynamicH"> @*contacttabledynamic*@
                        <tr>
                            <td colspan="3" class="clsNothanksmargin">
                                <input type="checkbox" name="nothanks" class="clsNothanksH" />
                                <b>I will provide my own.</b>
                            </td>
                        </tr>
                        <tr>
                            <td><b>Qty</b>
                            </td>
                            <td>
                            </td>
                            <td>
                                <b>$ PRICE</b>
                            </td>
                        </tr>
                        @{Int32 inc = 0;}
                        @foreach (var item in @Model.listSubHardwareDetailModel.ToList())
                        {
                            if (@item.SubHardwareID == @items.SubHardwareID)
                            {
                         
                            <tr class="countforPlansH" id="@item.SubHardwareDetailID" >
                                <td>
                                 @{
                                int selectedQuantity = 0;
                                 }

                                  @Html.DropDownListFor(model => @items.SubHardwareDetailID, new SelectList(new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, selectedQuantity), new { @class = "rdselectdynamicH", @rel = inctop, @rel1 = inctopH }) 
 
                                   @*@Html.RadioButtonFor(m => @item.SubHardwareDetailName, @item.SubHardwareDetailID, new { @class = "rdselectdynamic", @rel = inctop })*@
                                </td>
                                <td>
                                    @item.SubHardwareDetailName
                                </td>
                                <td>
                                    @item.SubHardwareDetailPrice
                                </td>
                            </tr>
                                inc++;
                            }

                        }
                        <tr style="background-color: transparent;">
                            <td>
                                <span class="divErrDynamicGridMultipleH validation-summary-errors font10" style="display: none;">
                                </span>
                            </td>
                        </tr>
                    </table>
                     @if (inctopH != Convert.ToInt32(Model.listSubHardwareModel.Count()))
                     { 
                        <a id="aMoveNext_@(inctopIncH)" class="floatright adynamicNext next" href="javascript:void(0);">
                            Next</a>
                     }
                    </div>
                     inctopH++;
                 }
                 @*Dynamic Loop Hardware End*@
             }
        </div>
        <br />
    
        <div>
            <div class="floatleft">
                <a href="@Url.Action("Availability", "signUp", new { id = @Model.ID })">
                    <input id="btnback" type="button" value="Back" class="btncolor btnbottom" /></a></div>
            <div class="padlef500new">
                <input type="submit" value="Next" id="btnNextSubmit" onclick="return btnclickNextSubmit();"
                    class="btncolor btnbottom" /></div>
        </div>
   
        @Html.Hidden("hdnCheckvalidationString", @Url.Action("CheckvalidationString", "signUp"))
        @Html.Hidden("hdnCheckvalidationInteger", @Url.Action("CheckvalidationInteger", "signUp"))
        @Html.Hidden("hdnCheckvalidationEmail", @Url.Action("CheckvalidationEmail", "signUp"))
        @Html.Hidden("hdnCheckvalidationAddress", @Url.Action("CheckvalidationAddress", "signUp"))
        @Html.Hidden("hdnCheckvalidationTitle", @Url.Action("CheckvalidationTitle", "signUp"))
        @Html.Hidden("hdnCheckvalidationAdsl", @Url.Action("CheckvalidationAdsl", "signUp"))
        @Html.Hidden("hdnCheckvalidationUsername", @Url.Action("CheckvalidationUsername", "signUp"))
        @Html.Hidden("hdnTick", @Url.Content("~/Content/images/tick.png"))
        @Html.Hidden("hdnCross", @Url.Content("~/Content/images/cross.png"))

        @Html.Hidden("hdnReplace", @Url.Action("ReplaceText", "signUp", new { id = @Model.ID }))
        @Html.Hidden("hdnBundleADSLHome", ((int)(Everynet.Models.signUpModel.enumPlanNames.BundleADSLHomephone)))
        @Html.Hidden("hdnBundleADSLVOIP", ((int)(Everynet.Models.signUpModel.enumPlanNames.BundleADSLVOIP)))
        @Html.Hidden("hdnBundleADSLPhoneVOIP", ((int)(Everynet.Models.signUpModel.enumPlanNames.BundleADSLHomephonePlusVOIP)))

        @Html.Hidden("hdnNaked", @Everynet.Models.signUpModel.enumNoServiceNumber.Naked.ToString())
        @Html.Hidden("hdnBundle", @Everynet.Models.signUpModel.enumNoServiceNumber.Bundle.ToString())
    }
</div>
@section JavaScriptSignUp
{
    
     <script type="text/javascript">
     function getplanQuota(planQuotaID) {
        $.ajax({
            url: "@Url.Action("changeMainQuotawithSubPlanID", "signUp")",
            data: {ID: planQuotaID},
            dataType: "json",
            type: "POST",
            error: function() {
                alert("An error occurred.");
            },
            success: function(data) {
               var html_ = "";
                      html_ += "<tbody><tr>";
                      html_ += "<td>";
                      html_ += "<b>Minimum Term</b>";
                      html_ += "</td>";
                      
                      html_ += "<td>";  
                      html_ += "<b>Setup Cost</b>";  
                      html_ += "</td>";  
                      
                      html_ += "<td>";  
                      html_ += "<b>Exit Fee</b>";
                      html_ += "</td>";
                      
                      html_ += "<td>";
                      html_ += "<b>Description</b>";
                      html_ += "</td>";
                      html_ += "</tr>";

                $.each(data, function(i, item) {
              
                           html_ += "<tr>";
                                   if(i==0)
                                   {
                                  html_ += "<td><input type='radio' value="+ item.PlanQuotaID +" name='item.value.PlanQuotaValue' id='item_value_PlanQuotaValue' data-val-required='The PlanQuotaValue field is required.' data-val-number='The field PlanQuotaValue must be a number.' data-val='true' checked='checked' class='rdselectcontract'><text>&nbsp;</text>"+item.PlanQuotaValue+"<text>&nbsp;</text>"+ item.PlanQuotaInterval+"</td>";
                                  $("#PlanQuotaID").val(item.PlanQuotaID);
                                  }
                                  else
                                  {
                                   html_ += "<td><input type='radio' value="+ item.PlanQuotaID +" name='item.value.PlanQuotaValue' id='item_value_PlanQuotaValue' class='rdselectcontract'><text>&nbsp;</text>"+item.PlanQuotaValue+"<text>&nbsp;</text>"+ item.PlanQuotaInterval+"</td>";
                                  }
                                  html_ += "<td>$"+item.SetupCost.toFixed(2) +"</td>";
                                  html_ += "<td>$"+item.EarlyExitFee.toFixed(2)+"</td>";
                                  html_ += "<td>";
                                 var cmt="";
                                 if(item.Comment==null)
                                 {
                                 cmt="";
                                 }
                                 else
                                 {
                                   cmt=item.Comment;
                                  }
                                  html_+=cmt;
                                  html_ +="</td>";
                                  html_ += "</tr>";
                 });
                  html_ += "</tbody>";
               $("#tblMainContract").html(html_);
           }
        });
               
    }

     function getplanQuotaExtras(planQuotaID,obj1,rel1,name1) {
       
        $.ajax({
            url: "@Url.Action("changeExtrasMainQuota", "signUp")",
            data: {ID: planQuotaID},
            dataType: "json",
            type: "POST",
            error: function() {
                alert("An error occurred.");
            },
            success: function(data) {
             
                            var html_ = "";
                            html_ += "<tbody><tr>";
                            html_ += "<td>";
                            html_ += "<b>Minimum Term</b>";
                            html_ += "</td>";
                            html_ += "<td>";
                            html_ += "<b>Setup Cost</b>";
                            html_ += "</td>";
                            html_ += "</tr>";

                         $.each(data, function(i, item) {
                                html_ += "<tr>";
                                if(i==0)
                                {
                                html_ += "<td><input type='radio' value="+ item.ExtraPlanQuotaID+" rel="+rel1+"_con name="+name1+"_con id='itemcon_ExtraPlanQuotaValue' data-val-required='The ExtraPlanQuotaValue field is required.' data-val-number='The field ExtraPlanQuotaValue must be a number.' data-val='true' class='rdselectcontractdynamic'><text>&nbsp;</text>"+item.ExtraPlanQuotaValue+"<text>&nbsp;</text>"+item.ExtraPlanQuotaInterval+"</td>";
                                }
                                else
                                {
                                html_ += "<td><input type='radio' value="+ item.ExtraPlanQuotaID+" rel="+rel1+"_con name="+name1+"_con id='itemcon_ExtraPlanQuotaValue' class='rdselectcontractdynamic'><text>&nbsp;</text>"+item.ExtraPlanQuotaValue+"<text>&nbsp;</text>"+item.ExtraPlanQuotaInterval+"</td>";
                                }
                                html_ += "<td>$"+item.ExtraSetupCost.toFixed(2)+"</td>";
                                html_ += "</tr>";
                                html_ +="<tr> </tr><tr> </tr>";

                             });

                            html_ += "</tbody>";
                          var objdiv=  obj1.closest(".contactdetal").find("#tblMainContractExtras");
                          objdiv.html(html_);
                        
            }
        });
                  
                 
                
      }

    </script>
    @Scripts.Render("~/Scripts/BundledScriptsSignupConfiguration")
     @*<script src="../../Scripts/client/signUp.js" type="text/javascript"></script>
   <script src="../../Scripts/client/configuration.js" type="text/javascript"></script>
    <script src="../../Scripts/client/configurationDetail.js" type="text/javascript"></script>*@
  }
